<template>
  <el-popconfirm
    :key="$attrs.id"
    :icon="icon"
    :title="title"
    :icon-color="iconColor"
    :confirm-button-text="confirmButtonText"
    :cancel-button-text="cancelButtonText"
    @confirm="$attrs.confirm()"
  >
    <slot slot="reference" />
  </el-popconfirm>
</template>

<script>
export default {
  name: 'PopConfirm',
  props: {
    // 图标
    icon: {
      type: String,
      default: 'el-icon-info'
    },
    // 提示标题
    title: {
      type: String,
      default: '确定删除吗？'
    },
    // 图标
    iconColor: {
      type: String,
      default: 'red'
    },
    // 取消按钮
    cancelButtonText: {
      type: String,
      default: '取消'
    },
    // 确定按钮
    confirmButtonText: {
      type: String,
      default: '确定'
    }
  },
  data() {
    return {}
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {}
}
</script>

<style lang="scss">
.el-popconfirm {
  .el-popconfirm__main {
    padding: 10px 0 !important;
  }
}
</style>
